package com.ytjj.qmyx.users.mapper;

import com.ytjj.qmyx.users.model.UsersBalanceRecord;
import com.ytjj.qmyx.users.model.UsersBalanceRecordExample;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.ytjj.qmyx.users.model.UsersBalanceRecordStatistics;
import com.ytjj.qmyx.users.model.UsersYestoryDayAndLasterWeekIncome;
import org.apache.ibatis.annotations.Param;

public interface UsersBalanceRecordMapper {
    long countByExample(UsersBalanceRecordExample example);

    int deleteByExample(UsersBalanceRecordExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(UsersBalanceRecord record);

    int insertSelective(UsersBalanceRecord record);

    List<UsersBalanceRecord> selectByExample(UsersBalanceRecordExample example);

    UsersBalanceRecord selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") UsersBalanceRecord record, @Param("example") UsersBalanceRecordExample example);

    int updateByExample(@Param("record") UsersBalanceRecord record, @Param("example") UsersBalanceRecordExample example);

    int updateByPrimaryKeySelective(UsersBalanceRecord record);

    int updateByPrimaryKey(UsersBalanceRecord record);

    List<UsersBalanceRecordStatistics> weekTask(Date startTime, Date endTime, String source);

    UsersBalanceRecordStatistics myIncomeAmount(Integer userId, Date startTime, Date endTime, String source);

    int saveUsersBalanceRecordWeekStaticstics(UsersBalanceRecordStatistics statistics);

    int saveUsersBalanceRecordMonthStaticstics(UsersBalanceRecordStatistics statistics);

    UsersYestoryDayAndLasterWeekIncome queryYestoryDayAndLasterWeekIncomeAmount(@Param("userId") Integer userId, @Param("source") String source);

    UsersBalanceRecord newestAddRecordByUserId(Integer userId);
}